package com.yhny.lykj.yuhannongye.ui;

import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.yhny.lykj.yuhannongye.R;
import com.yhny.lykj.yuhannongye.app.BaseTabPagerActivityNoNet;

import java.util.ArrayList;
import java.util.List;

public class MyOrderListActivity extends BaseTabPagerActivityNoNet {

    int FROM_TYPE =0;
    @Override
    protected int getLayoutResource() {
        return R.layout.activity_my_order_list;
    }

    @Override
    protected void onSetContentViewAfter() {
        FROM_TYPE= getIntent().getIntExtra(ORDER_FROM,0);
        TextView title = (TextView)findViewById(R.id.name_top_bar);
        findViewById(R.id.left_group).setOnClickListener(this);
        findViewById(R.id.left_text).setOnClickListener(this);
        title.setText("我的订单");
    }
    @Override
    protected List<Fragment> getFragmentList() {
        ArrayList<Fragment> fragments = new ArrayList<>();
        fragments.add(new OrderFragment());//全部订单
        fragments.add(new OrderPayFragment());//代付款
        fragments.add(new OrderPostFragment());//待发货
        fragments.add(new OrderAddressFragment());//待收货
        return fragments;
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.left_text:
            case R.id.left_group:{
                finish();
                break;
            }
        }
    }
    @Override
    protected int setTabPage() {
        return FROM_TYPE;
    }

    @Override
    protected List<String> getTitleList() {
        ArrayList<String> titleList = new ArrayList<>();
        titleList.add("全部订单");
        titleList.add("待发货");
        titleList.add("已发货");
        titleList.add("已完成");
        return titleList;
    }
}
